@model IEnumerable<TimeManager.Domain.Entities.Project>
@{
    ViewBag.Title = "Projects";
}
<h2>@ViewBag.Title</h2>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Actions
        </th>
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            Category
        </th>
        <th>
            Reports
        </th>
    </tr>
    @foreach (var item in Model) {
        <tr>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ProjectId }) |
                @Html.ActionLink("Details", "Details", new { id = item.ProjectId }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.ProjectId })
            </td>
            <td>
                @item.Name
            </td>
            <td>
                @item.Description
            </td>
            <td>
                @(item.Category == null ? "None" : item.Category.Name)
            </td>
            <td>
                @Html.ActionLink("Reports", "Index", "Reports")
            </td>
        </tr>
    }
</table>
<p>
    @Html.ActionLink("Create New", "Create")
</p>
